/*
 * socket.h
 *
 *  Created on: 03/10/2011
 *      Author: guido
 */

#ifndef SOCKET_H_
#define SOCKET_H_

#include <stdio.h>
#include <stdlib.h>
#include <errno.h>
#include <string.h>
#include <netdb.h>
#include <arpa/inet.h>
#include <sys/types.h>

class Socket {
public:
	Socket(char* puerto, char* direccion);
	Socket(int sockfd);
	~Socket();
	void enviar(char* buffer, int tamanyo);
	void recibir(char* buffer, int tamanyo);
	bool valido();

protected:
	int sockfd;
	struct sockaddr_in address;
};


#endif /* SOCKET_H_ */
